package com.example.service;

import com.example.pojo.Appointment;
import com.github.pagehelper.PageInfo;

import java.util.List;

public interface AppointmentService {
    /**
     * 查询所有预约
     * @return
     */
    List<Appointment> selectAll(Integer userId,String role);

    /**
     * 根据id查询预约
     * @param id
     * @return
     */
    Appointment selectById(Integer id);

    /**
     * 分页查询
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageInfo<Appointment> selectPage(Appointment appointment,Integer pageNum, Integer pageSize);

    /**
     * 添加收藏
     * @param appointment
     */
    void add(Appointment appointment);

    /**
     * 删除
     * @param
     */
    void deleteById(Integer userId, Integer roomId);


    Boolean isAppointment(Integer userId, Integer roomId);

    /**
     * 取消预约
     * @param id
     * @param cancelReason
     */
    void cancelAppointment(Integer id, String cancelReason);

    /**
     * 房东确定预约
     * @param id
     */
    void confirmAppointment(Integer id);

    /**
     * 获取待处理的预约数量
     * @return
     */
    int unProcessedCount(Integer ownerId);
}
